package handlers

import (
	"github.com/emicklei/go-restful"
)

type Error struct {
	//http  错误码
	StatusCode int `json:"status_code"`
	//错误信息
	ErrorMessage string `json:"error_message"`
}

func RenderError(w *restful.Response, ErrorMessage string, statusCode int) {
	var data Error

	data.StatusCode = statusCode
	data.ErrorMessage = ErrorMessage

	w.WriteHeaderAndJson(statusCode, data, restful.MIME_JSON)
}

type SuccessResp struct {

	StatusCode int `json:"status_code"`

	Message string `json:"message"`
}
